from selenium import webdriver
from time import sleep

bro = webdriver.Chrome('./chromedriver.exe')
bro.get('https://www.taobao.com')

search_input = bro.find_element_by_id('q')
search_input.send_keys('iphone')

# btn = bro.find_element_by_css_selector('btn-search tb-bg')
btn = bro.find_element_by_class_name('search-button')
btn.click()
sleep(2)

bro.get('https://baidu.com')
sleep(3)
bro.back()
sleep(3)
bro.forward()

bro.execute_script('window.scrollTo(0,document.body.scrollHeight)')
sleep(2)
bro.quit()
